#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
using namespace std;

struct TreeNode
{
    int val;
    struct TreeNode *left;
    struct TreeNode *right;
    TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};

//把二叉树打印成多行，队列
vector<vector<int>> Print(TreeNode *pRoot)
{
    if (!pRoot)
    {
        return {};
    }
    vector<vector<int>> res;
    queue<TreeNode *> q;
    q.push(pRoot);
    while (!q.empty())
    {
        int len = q.size(); //当前队列长度，即当前层的节点个数
        vector<int> tmp;
        for (int i = 0; i < len; ++i)
        {
            TreeNode *t = q.front();
            q.pop();
            if (t)
            {
                tmp.push_back(t->val);
                q.push(t->left);
                q.push(t->right);
            }
        }
        if (!tmp.empty())
        {
            res.push_back(tmp);
        }
    }
    return res;
}

void test()
{
}

int main()
{
    test();
    return 0;
}